1. Field of the Invention
The present invention relates to a decoding method, and more particularly, to a decoding method for reducing a delay time to operate a decoder continuously by controlling the relief width of a decoding buffer according to the characteristics of an input image. The present invention is based on Korean Patent Application Nos. 00-31950 and 00-56422, which are incorporated herein by reference.
2. Description of the Related Art
FIG. 1 is a drawing showing the structure of a general decoding buffer.
FIG. 2 is a drawing showing the relief width of a decoding buffer which has a conventional fixed size.
In FIG. 1, a concept of In/Out of a decoding input buffer means effective data which is input/output on the basis of the buffer. Referring to FIG. 1, when a decoding input buffer is allocated at an early stage, data has not yet been recorded in the buffer, so that the input position (In) of the effective data of the buffer is 0. Also, since the data has not yet been read from the buffer, the output position (Out) of the effective data is 0. In (b), the effective data is input into the decoding input buffer, and the buffer size is bigger than the data input position (In) and the output position (Out) is 0. In (c), the input and output of the effective data are performed at the same time, and the input position (In) of the effective data is larger than the output position (Out) and smaller than the buffer size. In (d), the effective data is input up to the end of the buffer, and the input position (In) of the effective data is the same as the buffer size and larger than the output position (Out). In (e), the input effective data is circulated, and the output position (Out) is larger than the input position (In) and smaller than the buffer size. In (f), the outputted effective data indicates the end of the buffer, and the output position (Out) is the same as the buffer size and larger than the input position (In). In (g), the outputted effective data is circulated, and the input position (In) is larger than the output position (Out) and smaller than the buffer size.
The management of the input and output of the decoding input buffer is performed in the following order. First, before input/output from the decoding input buffer are performed, it is confirmed whether sufficient effective space/data exists. Only when this condition is satisfied can the real data be input or output. Second, as a read/write operation performed in the real decoding input buffer, it is important that the decoding input buffer is operated by a circular queue, in order to efficiently use the allocated decoding input buffer size. Here, if the value of the input position and output position becomes larger than the buffer size during the operation, the value returns to 0. After the pointer renewal is finished, the part of indicating the effective data size is renewed.
Among the above terms, effective data means data that has not been output after being input once, that is, data that is expected to be output in the future. Relief space means a region in which data is never input or after data is input once, the data is output once, that is, a region in which data is already output so that data can be input again.
It is desirable for the relief width (relief space) of the decoding input buffer to be large enough not to stop the operation of the decoder because of the shortage of data. However, a delay during decoding may occur. Accordingly, the larger the relief width of the buffer, the longer the delay becomes. Thus, it is preferable to set up an appropriate size of the relief width. If the delay time of the image data becomes longer, the user may feel uncomfortable in watching the screen. As shown in FIG. 2, conventionally the relief width is fixed, so that a fixed delay is produced regardless of the type of the image data.